<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
    
    <title>查看单个用户信息</title>
  </head>
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
%>

  <body>
  <h3>请输入你要查找的用户名</h3>
  <br>
  <form action="${contextPath }/showUser.do?operation=getUser" method="post">
  <input type="text" name="userName" id="userName"/><input type="submit" value="搜索">
  </form>
    <br><div id="userMsg">
    <table>
     <tr>
       <td>用户名：
        </td>
        <td>${user.userName} 
        </td>
     </tr>
      <tr>
       <td>真实姓名：
        </td>
        <td>${user.realName} 
        </td>
     </tr>
      <tr>
       <td>性别：
        </td>
        <td>${user.sex} 
        </td>
     </tr>
      <tr>
       <td>联系方式：
        </td>
        <td>${user.userPhone} 
        </td>
     </tr>
      <tr>
       <td>所在地：
        </td>
        <td>${user.userAddress} 
        </td>
     </tr>
      <tr>
       <td>邮箱：
        </td>
        <td>${user.email} 
        </td>
     </tr>
     <tr>
       <td>拥有的金点值：
        </td>
        <td>${user.card.cardValue} 
        </td>
     </tr>
      
    </table>
    <hr>



<ul><h4>用户拍到的商品</h4>
  <c:choose>
  <c:when test="${totalPage>0}">
 <c:forEach var="endauctions" items="${user.endauctions}" begin="${beginPoint}" end="${endPoint}">
 <li>商品名：<a href="#"><font size="5">${endauctions.product.productName}</font></a>&nbsp;&nbsp;&nbsp;&nbsp;竞拍结束的时间：${endauctions.endTime}&nbsp;&nbsp;&nbsp;&nbsp;最终的价格：${endauctions.product.currentPrice}</li>
 </c:forEach>
 </c:when>
 </c:choose>
</ul> 
  <table align="center">
       <c:choose>
       
      <c:when test="${totalPage>0}">
     
        <tr>
          <td><a href="${contextPath }/showUser.do?operation=getUser&page=1&userName=${ user.userName}">第一页</a>
          <td><a href="${contextPath }/showUser.do?operation=getUser&page=${requestScope.curPage - 1}&userName=${ user.userName}">上一页</a></td>
          <td><a href="${contextPath }/showUser.do?operation=getUser&page=${requestScope.curPage + 1}&userName=${ user.userName}">下一页</a></td>
          <td><a href="${contextPath }/showUser.do?operation=getUser&page=${requestScope.totalPage}&userName=${ user.userName}">最后一页</a></td> 
          <td>${curPage}/${totalPage}</td>
        </tr>
  
     </c:when>
     <c:otherwise>
     <tr>
       <td> <span>&nbsp;${message }</span></td>
     </tr>
      
     </c:otherwise>
    
     </c:choose>
    </table>
<hr>


<form action="${contextPath }/showUser.do?operation=modifyUser&userName=${user.userName}" method="post">
<c:choose>
  <c:when test="${user.type eq 0}">
  <input type="radio" name="type" value="0"checked/>系统管理员
<input type="radio" name="type" value="1"/>机器人
<input type="radio" name="type" value="2"/>注册用户
  </c:when>
  <c:when test="${user.type eq 1}">
  <input type="radio" name="type" value="0" />系统管理员
<input type="radio" name="type" value="1"checked=/>机器人
<input type="radio" name="type" value="2"/>注册用户
  </c:when>
  <c:otherwise>
  <input type="radio" name="type" value="2" />系统管理员
<input type="radio" name="type" value="1" />机器人
<input type="radio" name="type" value="2"checked/>注册用户
  </c:otherwise>
</c:choose>


<input type="submit" value="修改用户权限"></form><font color="red">${msg }</font>
    </div>
  </body>
</html>
